<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved. */
/*
 * 默认布局文件
 * @param title 页面标题
 * @param bodyClass body标签的class内容
 * @param libs 要引用的js或css类库
 */
var themeName = @Global.getConfig('web.view.themeName', 'default');
%>
<% print('<'+'!DOC'+'TYPE html'+'>'); %>
<% print('<'+'html'+'><'+'head'+'>'); %>
<% include('/include/head.html', {title: text(title!)}){} %>
<% include('/themes/'+themeName+'/include/header.html', {libs: libs!}){} %>
</head><body class="hold-transition ${bodyClass!}">
<% if (!@ListUtils.inString('layout', libs!)){ %>
<div class="wrapper">${layoutContent}</div>
<% }else{ %>${layoutContent}<% } %>
<a id="scroll-up" href="#" class="btn btn-sm"><i class="fa fa-angle-double-up"></i></a>
<% include('/themes/'+themeName+'/include/footer.html', {libs: libs!}){} %>
<script type="text/javascript">
 //处理键盘事件 禁止后退键（Backspace）密码或单行、多行文本框除外
 function forbidBackSpace(e) {
  var ev = e || window.event; //获取event对象
  var obj = ev.target || ev.srcElement; //获取事件源
  var t = obj.type || obj.getAttribute('type'); //获取事件源类型
  //获取作为判断条件的事件类型
  var vReadOnly = obj.readOnly;
  var vDisabled = obj.disabled;
  //处理undefined值情况
  vReadOnly = (vReadOnly == undefined) ? false : vReadOnly;
  vDisabled = (vDisabled == undefined) ? true : vDisabled;
  //当敲Backspace键时，事件源类型为密码或单行、多行文本的，
  //并且readOnly属性为true或disabled属性为true的，则退格键失效
  var flag1 = ev.keyCode == 8 && (t == "password" || t == "text" || t == "textarea") && (vReadOnly == true || vDisabled == true);
  //当敲Backspace键时，事件源类型非密码或单行、多行文本的，则退格键失效
  var flag2 = ev.keyCode == 8 && t != "password" && t != "text" && t != "textarea";
  //判断
  if (flag2 || flag1) return false;
 }
 //禁止后退键 作用于Firefox、Opera
 document.onkeypress = forbidBackSpace;
 //禁止后退键  作用于IE、Chrome
 document.onkeydown = forbidBackSpace;
</script>
